#include <bits/stdc++.h>
#define fi first
#define se second
using ll = long long;
using namespace std;
void solve()
{
    int n, m;
    cin >> n >> m;
    while (1)
    {
        int ans = abs(n - m);
        if (ans <= 1)
        {
            cout << n + m;
            break;
        }
        if (n > m)
            n--;
        else
            m--;
    }
}
int main()
{
    cin.tie(nullptr);
    cout.tie(nullptr);
    ios::sync_with_stdio(false);
    int T = 1;
    // cin>>T;
    while (T--)
    {
        solve();
    }
    return 0;
}